package com.qlogic.commons.utils.reflect;

import java.io.Serializable;
import java.util.ArrayList;

public class DecoratedSource implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3478429195824038527L;
	
	private String name;
	private Object source;
	private ArrayList messages = new ArrayList ();
	
	public DecoratedSource () {
	}
	
	public DecoratedSource (String name) {
		this.name = name;
	}
	
	public DecoratedSource (String name, Object source) {
		this.name = name;
		this.source = source;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public Object getSource() {
		return source;
	}
	
	public void setSource(Object source) {
		this.source = source;
	}
	
	public void addMessage (SourceMessage message) {
		messages.add (message);
	}
	
	public int getMessagesCount () {
		return messages.size ();
	}
	
	public SourceMessage getMessage (int index) {
		return (SourceMessage) messages.get (index);
	}
	
}
